<template>
  <el-form-item :label="label" :prop="prop" class="form-field">
    <el-row :gutter="20" class="w-full">
      <el-col :span="span">
        <slot>
          <component :is="inputComponent" v-bind="$attrs" />
        </slot>
      </el-col>
    </el-row>
  </el-form-item>
</template>

<script setup lang="ts">
  defineProps({
    label: String,
    prop: String,
    span: {
      type: Number,
      default: 20,
    },
    inputComponent: {
      type: [String, Object],
      default: 'div',
    },
  });
</script>

<style lang="scss" scoped>
  .form-field {
    margin-bottom: 18px;

    :deep(.el-form-item__label) {
      font-weight: 500;
      color: #606266;
    }
  }
</style>
